@extends('admin.layout')
@section('title', $title)

@section('content')
 <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                订单管理
                <small>在这里, 你可以编辑你的用户
                    @if(session('info'))
                        <span id='info' class="text-red">{{session('info')}}</span>
                    @endif
                </small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="{{ url('/admin/index')}}"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="{{ url('/admin/user/index') }}">订单管理</a></li>
                <li class="active">编辑</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">快速编辑订单</h3>

                        </div><!-- /.box-header -->
                        <!-- form start -->
                        <form role="form" action="{{ url('/admin/order/update')}} " method="post" enctype="multipart/form-data">
                        	{{ csrf_field()}}
                            <div class="box-body">
                                <input type="hidden" name="id" value="{{$orderdata -> id }}">
                                <input type="hidden" name="uid" value="{{$orderdata -> uid }}">
                                <div class="form-group">
                                    <label for="exampleInputEmail1">收货人</label>
                                    <input type="text" class="form-control right" value="{{ $orderdata -> rec}}" name="name" id="exampleInputEmail1"required="required">
                                </div> 
                                <div class="form-group">
                                    <label for="exampleInputEmail1">地址</label>
                                    <input type="text" class="form-control right" value="{{ $orderdata -> addr}}" name="addr" id="exampleInputEmail1"required="required">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">手机号</label>
                                    <input type="text" class="form-control right" value="{{ $orderdata -> tel}}" name="tel" id="exampleInputEmail1"required="required">
                                </div>
                                <div class="form-group">
                                    <label for="exampleInputEmail1">买家留言</label>
                                    <input type="text" class="form-control right" value="{{ $orderdata -> umsg}}" name="umsg" id="exampleInputEmail1"required="required">
                                </div>                               
                            </div><!-- /.box-body -->
                            <div class="box-footer">
                                <button type="submit" class="btn btn-primary">修改</button>
                                
                            </div>
                        </form>
                        <table id="example2" class="table table-bordered table-hover">
                        <thead>
                                <tr>

                                    <th>用户名</th>
                                    <th>商品名称</th>
                                    <th>商品图片</th>
                                    <th>类别</th>
                                    <th>单价</th>
                                    <th>数量</th>
                                    <th>小计</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($detaildata as $row)                              
                                <tr>
                                    <td class='td_name'>{{$username}}</td>
                                    <td>{{$row -> gid -> gname}}</td>
                                    <td ><img style="width:45px" src="{{ asset($row -> gid -> gpic)}}" alt=""></td>
                                    <td>{{$row -> gid -> pid}}</td>
                                    <td>{{$row -> price}}</td>
                                    <td>{{$row -> count}}</td>
                                    <td>{{($row -> price)*($row -> count)}}</td>
                                </tr>
                                @endforeach
                        </table>

                    </div><!-- /.box -->

                    <!-- Form Element sizes -->
                </div><!--/.col (left) -->
                <!-- right column -->
            </div>   <!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    <script>
    window.onload=function()
    {
        $('#info').fadeOut(1000);
    };
    </script>
@endsection